import { axios } from "@/request/request";

/**
 * 获取分页校园帖子列表
 * @param {*} data
 * @returns {object}
 */
export const getSchoolPostsList = data => {
  return axios({
    url: "/getSchoolPostsList",
    method: "post",
    data,
  });
};
/**
 * 获取分页世界帖子列表
 * @param {*} data
 * @returns {object}
 */
export const getWorldPostsList = data => {
  return axios({
    url: "/getWorldPostsList",
    method: "post",
    data,
  });
};
/**
 * 获取分页游客状态帖子列表
 * @param {*} data
 * @returns {object}
 */
export const getLimitPostsList = data => {
  return axios({
    url: "/getLimitPosts",
    method: "post",
    data,
  });
};
/**
 * 获取用户赞过的帖子id
 * @param {*} data
 * @returns
 */
export const getUserLikedPosts = data => {
  return axios({
    url: "/getUserLikedPosts",
    method: "post",
    data,
  });
};
/**
 * 添加用户赞过的帖子id
 * @param {*} data
 * @returns
 */
export const addUserLikedPosts = data => {
  return axios({
    url: "/addUserLikedPosts",
    method: "post",
    data,
  });
};
/**
 * 删除用户赞过的帖子id
 * @param {*} data
 * @returns
 */
export const delUserLikedPosts = data => {
  return axios({
    url: "/delUserLikedPosts",
    method: "post",
    data,
  });
};
/**
 * 点赞
 * @param {*} data
 * @returns
 */
export const giveLike = data => {
  return axios({
    url: "/giveLike",
    method: "post",
    data,
  });
};
/**
 * 取消点赞
 * @param {*} data
 * @returns
 */
export const cancelLike = data => {
  return axios({
    url: "/cancelLike",
    method: "post",
    data,
  });
};
/**
 * 发布帖子
 * @param {*} data
 * @returns
 */
export const publishPost = data => {
  return axios({
    url: "/publishPost",
    method: "post",
    data,
  });
};
/**
 * 获取帖子分类
 * @param {*} data
 * @returns
 */
export const getPostsType = data => {
  return axios({
    url: "/getPostsType",
    method: "post",
    data,
  });
};
/**
 * 获取帖子类别获取相应的话题标签
 * @param {*} data
 * @returns
 */
export const getTagList = data => {
  return axios({
    url: "/getTagList",
    method: "post",
    data,
  });
};
/**
 * 根据关键词获取话题标签列表
 * @param {*} data
 * @returns
 */
export const getSearchTagList = data => {
  return axios({
    url: "/getSearchTagList",
    method: "post",
    data,
  });
};
